function popupHandle ({ attr = 'isShow', flag = true, key = 'popupType', type = '' } = {}, self = null) {
  if (!attr) return

  (self || this).setData(Object.assign({
    [attr]: flag
  }, type && flag ? {
    [key]: type
  } : {}))
}

function quickPopupHandle (e) {
  popupHandle(e.currentTarget.dataset, this)
}

module.exports = {
  popupHandle,
  quickPopupHandle
}
